﻿<UserControl x:Class="TecX.Agile.View.StoryCard"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:Behavior="clr-namespace:TecX.Agile.View.Behavior" 
    xmlns:Converter="clr-namespace:TecX.Agile.View.Converter"
    mc:Ignorable="d" 
    d:DesignHeight="200" 
    d:DesignWidth="300">
    <Interactivity:Interaction.Behaviors>
        <Behavior:RntBehavior/>
    </Interactivity:Interaction.Behaviors>
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/NamedStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Converter:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrush_ValueConverter" />
            <Converter:StringToDoubleConverter x:Key="StringToDouble_ValueConverter" />
        </ResourceDictionary>
    </UserControl.Resources>
    <Border                    
        BorderBrush="Black"
        BorderThickness="1">
        <Grid 
        Background="{Binding Path=Background, Converter={StaticResource ColorToSolidColorBrush_ValueConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="2*" MinHeight="25"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="12*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBox
            x:Name="TaskName" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.ColumnSpan="3"
            Text="{Binding Path=Name, UpdateSourceTrigger=Default}">
                <Interactivity:Interaction.Behaviors>
                    <Behavior:TextBoxHideBehavior/>
                    <Behavior:HighlightFieldBehavior UniqueFieldName="TaskName"/>
                </Interactivity:Interaction.Behaviors>
            </TextBox>
            <Rectangle
            Grid.ColumnSpan="3"
            Style="{StaticResource TopSeparator}"/>
            <TextBox 
            x:Name="MostLikelyEstimate"
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1"
            Text="{Binding Path=MostLikelyEstimate, Converter={StaticResource StringToDouble_ValueConverter}, UpdateSourceTrigger=Default}">
                <Interactivity:Interaction.Behaviors>
                    <Behavior:TextBoxHideBehavior/>
                    <Behavior:HighlightFieldBehavior UniqueFieldName="MostLikelyEstimate"/>
                </Interactivity:Interaction.Behaviors>
            </TextBox>
            <TextBox 
            x:Name="ActualEffort" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1" 
            Grid.Column="1"
            Text="{Binding Path=ActualEffort, Converter={StaticResource StringToDouble_ValueConverter}, UpdateSourceTrigger=Default}">
                <Interactivity:Interaction.Behaviors>
                    <Behavior:TextBoxHideBehavior/>
                    <Behavior:HighlightFieldBehavior UniqueFieldName="ActualEffort"/>
                </Interactivity:Interaction.Behaviors>
            </TextBox>
            <TextBox 
            x:Name="TaskOwner" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1" 
            Grid.Column="2"
            Text="{Binding Path=TaskOwner, UpdateSourceTrigger=Default}">
                <Interactivity:Interaction.Behaviors>
                    <Behavior:TextBoxHideBehavior/>
                    <Behavior:HighlightFieldBehavior UniqueFieldName="TaskOwner"/>
                </Interactivity:Interaction.Behaviors>
            </TextBox>
            <TextBlock 
            Text="Mostlikely Estimate"
            Grid.Row="2"
            FontSize="8"/>
            <Rectangle 
            Grid.Row="1"
            Grid.ColumnSpan="3"
            VerticalAlignment="Bottom"
            Canvas.ZIndex="50"
            IsHitTestVisible="False"
            Style="{StaticResource Separator}" />
            <TextBlock
            Text="Actual Effort"
            Grid.Row="2"
            Grid.Column="1"
            FontSize="8" />
            <TextBlock
            Text="Task Owner"
            Grid.Row="2"
            Grid.Column="2"
            FontSize="8"/>
            <TextBox 
            x:Name="Description" 
            Style="{StaticResource HiddenTextBoxStyle}"
            TextWrapping="Wrap" 
            Grid.Row="3" 
            Grid.ColumnSpan="6" 
            VerticalContentAlignment="Top"
            AcceptsReturn="True" 
            AllowDrop="False"
            Text="{Binding Path=Description, UpdateSourceTrigger=Default}">
                <Interactivity:Interaction.Behaviors>
                    <Behavior:TextBoxHideBehavior/>
                    <Behavior:HighlightFieldBehavior UniqueFieldName="Description"/>
                </Interactivity:Interaction.Behaviors>
            </TextBox>
            <Grid 
            Grid.Row="2"
            Grid.RowSpan="2" 
            Grid.ColumnSpan="3" 
            IsHitTestVisible="False">
                <Rectangle x:Name="_sep1" Style="{StaticResource Separator}" Margin="0,25,0,0" />
                <Rectangle Style="{StaticResource Separator}" Margin="0,50,0,0" />
                <Rectangle Style="{StaticResource Separator}" Margin="0,75,0,0" />
                <Rectangle Style="{StaticResource Separator}" Margin="0,100,0,0" />
                <Rectangle Style="{StaticResource Separator}" Margin="0,125,0,0" />
            </Grid>
            <Grid            
            x:Name="Overlay" 
            Grid.RowSpan="4"
            Grid.ColumnSpan="3"
            IsHitTestVisible="false"/>
        </Grid>
    </Border>
</UserControl>
